
export const getUrlValue = (url?:string)=>{
     url = url ? url : window.location.href;
    if (url.indexOf('#') > -1) {
        url = url.split('#')[0];
    }
    let variable:string = url.split('?')[1];
    if (!variable) {
        return {};
    } else {
        var value = {};
       let  variables = decodeURIComponent(variable).split('&');
        for (var i = 0, m = variables.length; i < m; i++) {
            var tempv = variables[i].split('=')[1];
            if (typeof (tempv) != 'undefined') {
                if (tempv == 'null' || tempv == 'undefined') {
                    tempv = '';
                }
                tempv = decodeURIComponent(tempv).replace(/</g, '&lt;').replace(/>/g, '&gt;');
                value[variables[i].split('=')[0]] = tempv;
            }
        }
        return value;
    }

  
}
export const isExternal = (url = "") => {
  return /^https?:\/\//.test(url) || url.startsWith("//")|| url.startsWith("blob:");
};